/**
 * <p>Copyright (c) 2017 深圳市鹏途交通科技有限公司 				</p>
 * <p>		    All right reserved. 		     		</p>
 * <p>项目名称 ：深圳公路信息资源整合及国省检日常化监管管理        				</p>
 * <p>创建者 ：詹春贤 										</p>
 * <p>描   述  ：路政管理 - 涉路工程监管 - 涉路许可事项 					</p>
 * <p>最后修改 ：$: 2017年9月12日-下午5:58:04 v 1.0.0	 Administrator   $   </p>
 * 
*/

package com.pengtu.gsj.entity.lzgl;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.pengtu.gsj.entity.app.Attachment;
import com.pengtu.gsj.entity.base.IdEntity;

/**
 * 
 * InPorMat
 * 
 * 2017年9月12日 下午5:58:04
 * 
 * @version 1.0.0
 * 
 */
@Entity 
@Table(name = "T_LZ_INPORMAT")
public class InPorMat extends IdEntity{

	/**
	 * serialVersionUID:TODO
	 *
	 * @since 1.0.0
	 */
	private static final long serialVersionUID = 5778022026982437461L;
	private String city;	//地市
	private String year;	//年份
	private String orgName;	//单位名称
	private String inPorMat;	//涉路许可事项
	private Long checkNum;	//检查次数
	private String ifChecknote;	//是否有检查记录
	private String ifTimeRect;		//是否及时处理
	private String remark;		//备注
	
	private Integer bulletinNumber;		   //检测文件数
	private List<Attachment> attachments;	//加载附件
	
	
	public InPorMat() {
	}

	
	/**
	 * InPorMat.
	 * 适用：前端获取工程监督检查条件
	 * @param year
	 * @param inPorMat
	 */
	public InPorMat(String inPorMat) {
		this.inPorMat = inPorMat;
	}

	
	/**
	 * InPorMat.
	 *
	 * 适用：前端选择涉路工程监督内容
	 * @param orgName
	 * @param inPerMat
	 * @param checkNum
	 * @param ifChecknote
	 * @param ifTimeRect
	 */
	public InPorMat(String year, String orgName, String inPorMat, Long checkNum, String ifChecknote, String ifTimeRect) {
		this.year = year;
		this.orgName = orgName;
		this.inPorMat = inPorMat;
		this.checkNum = checkNum;
		this.ifChecknote = ifChecknote;
		this.ifTimeRect = ifTimeRect;
	}


	@Column(name = "CITY")
	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = "深圳市";
	}


	@Column(name = "YEAR")
	public String getYear() {
		return year;
	}

	public void setYear(String year) {
		this.year = year;
	}

	
	@Column(name = "ORGNAME")
	public String getOrgName() {
		return orgName;
	}

	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}


	@Column(name = "INPORMAT")
	public String getInPorMat() {
		return inPorMat;
	}

	public void setInPorMat(String inPorMat) {
		this.inPorMat = inPorMat;
	}


	@Column(name = "CHECKNUM")
	public Long getCheckNum() {
		return checkNum;
	}

	public void setCheckNum(Long checkNum) {
		this.checkNum = checkNum;
	}


	@Column(name = "IFCHECKNOTE")
	public String getIfChecknote() {
		return ifChecknote;
	}

	public void setIfChecknote(String ifChecknote) {
		this.ifChecknote = ifChecknote;
	}


	@Column(name = "IFTIMERECT")
	public String getIfTimeRect() {
		return ifTimeRect;
	}

	public void setIfTimeRect(String ifTimeRect) {
		this.ifTimeRect = ifTimeRect;
	}


	@Column(name = "remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}


	@Transient
	public Integer getBulletinNumber() {
		bulletinNumber = attachments.size();
		return bulletinNumber;
	}

	public void setBulletinNumber(Integer bulletinNumber) {
		this.bulletinNumber = bulletinNumber;
	}

	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name = "PARTID")
	public List<Attachment> getAttachments() {
		return attachments;
	}

	public void setAttachments(List<Attachment> attachments) {
		this.attachments = attachments;
	}
}
